<?php
$activeHeader = $this->ts_functions->getsettings('headers','active');
if($activeHeader=='Classic'){
	$bannerClass="tp_banner1";
}else if($activeHeader=='Modern'){
	$bannerClass="tp_banner2";
}else{
	$bannerClass="tp_banner3";
}
?>

<div class="tp_main_banner <?php echo $bannerClass; ?>">
	<div class="container">
		<div class="row">
			<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 col-lg-offset-2 col-md-offset-2">
				<div class="tp_banner_data">
					<h1><?php echo $this->ts_functions->getlanguage('bannerheading','homepage','solo');?></h1>
					<h4><?php echo $this->ts_functions->getlanguage('bannersubheading','homepage','solo');?></h4>
					<div class="tp_banner_form">
						
							<div class="tp_form-group ">
								<select class="form-control" id="home_cat_search">
									<option value="all"><?php echo $this->ts_functions->getlanguage('categories','commontext','solo');?></option>
								<?php if($categoryList){
									foreach($categoryList as $soloCate) {
									 echo '<option value="'.$soloCate['cate_urlname'].'">'.$soloCate['cate_name'].'</option>';	
									}
								} ?>
									
								</select>
							</div>
							<div class="form-group">
								<input type="text" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('searchplaceholder','homepage','solo');?>" id="searchInput">
								<button type="button" class="tp_search_btn" id="searchInputBtn"><i class="fa fa-search"></i> <?php echo $this->ts_functions->getlanguage('searchtext','homepage','solo');?></button>
							</div>
						
						<a href="<?php echo $basepath;?>home/products" class="tp_btn"><?php echo $this->ts_functions->getlanguage('topbutton','homepage','solo');?> </a>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- Feature wrapper Start -->
<?php if(!empty($featuredprod)) {?>
<div class="tp_gray_wrapper tp_toppadder80 tp_bottompadder50">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_heading_div tp_bottompadder50">
					<h2><?php echo $this->ts_functions->getlanguage('featuredbox','homepage','solo');?></h2>
				</div>
			</div>
			<?php
			foreach($featuredprod as $soloFet){
			   $prodName = $this->ts_functions->getProductName($soloFet['prod_id']);
			   $prodImage = $this->ts_functions->getProductPic($soloFet['prod_image']);
			   $prodUrl   = base_url().'item/'. $prodName.$soloFet['prod_uniqid'];
        	   
               $catename = strtolower($soloFet['cate_urlname']);
               $catename = str_replace(' ','-',$catename);
               $catename = preg_replace('!-+!', '-', $catename);
			   $cat_url  =base_url().'home/products/'. $catename;
               $prod_demourl='';
               if($soloFet['prod_demourl']){
				$prod_demourl= base_url().'item/'.$prodName.'live_demo/'.$soloFet['prod_uniqid']; 
			   }
               
			   if( $soloFet['prod_free'] == '0') {
				  $prod_price=$this->ts_functions->getsettings('portalcurreny','symbol').' '.$soloFet['prod_price']; 
			   }else{
				  $prod_price=$this->ts_functions->getlanguage('freetext','commontext','solo'); 
			   }
			   if( $this->ts_functions->getsettings('portal','revenuemodel') != 'subscription' ) {
				   $purDetail = $this->DatabaseModel->access_database('ts_purchaserecord','select','',array('purrec_prodid'=>$soloFet['prod_id']));
				   $prod_sale=count($purDetail);
			   }else{
				  $prod_sale=$soloFet['prod_download_count']; 
			   }
			   $vendorName = $this->ts_functions->getVendorName($soloFet['prod_uid']);
			   $vendo_url=base_url().'vendor/'.$vendorName;
			   $prod_title=$soloFet['prod_name'];
			   
			   ?> 
              <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
				<div class="tp_product_div">
					<div class="tp_product_img" >
						<img src="<?php echo $prodImage; ?>" class="img-responsive" alt="">
						<?php
                         if($prod_demourl!=''){?>
						  <div class="tp_overlay"></div>
							<div class="tp_overlay_btn">
								<a href="<?php echo $prod_demourl; ?>" class="tp_btn" target="_blank"><?php echo $this->ts_functions->getlanguage('livedemotab','homepage','solo');?></a>
							</div>	 
							 
						 <?php }?>
					</div>
					<div class="tp_product_data">
						<h3><a href="<?php echo $prodUrl; ?>"><?php echo $soloFet['prod_name'];  ?></a></h3>
						<p><?php echo substr(strip_tags($soloFet['prod_description']),0,150).' ...';?></p>
						<ul>
							<li><a href="<?php echo $vendo_url;  ?>"><i class="fa fa-user"></i> <?php echo ucfirst($vendorName); ?></a></li>
							<li><a href="<?php echo $cat_url; ?>"><i class="fa fa-tag"></i><?php echo $catename; ?></a></li>
						</ul>
						<div class="tp_divider"></div>
						
						<div class="tp_sales_data">
							<h4><i class="fa fa-shopping-cart"></i> <?php echo $prod_sale.' ' . $this->ts_functions->getlanguage('salestext','commontext','solo'); ?> </h4>
						</div>
						<div class="tp_price_div">
							<h4><?php echo $prod_price; ?></h4>
						</div>
						<div class="tp_btndiv">
							<a href="<?php echo $prodUrl; ?>" class="tp_btn"><?php echo $this->ts_functions->getlanguage('viewbtn','homepage','solo') ?></a>
						</div>
					</div>
				</div>
			</div>	
		   <?php }?>
		</div>
	</div>
</div>
<?php } ?>
<!-- Feature wrapper End -->

<?php if($this->ts_functions->getsettings('marketplace','typevendor') == 'multi') {?>
<div class="tp_white_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 tp_right_border_big">
				<div class="tp_selling_buying_div">
					<span><i class="flaticon-money"></i></span>
					<h3><?php echo $this->ts_functions->getlanguage('startselling','homepage','solo'); ?></h3>
					<p><?php echo $this->ts_functions->getlanguage('makemoney','homepage','solo'); ?></p>
					<?php
						 if(isset($this->session->userdata['ts_uname'])) {
							 if( $this->session->userdata['ts_level'] == '2' ) {
								 ?>
								<a class="tp_btn" data-toggle="modal" data-target="#tnc_popup"><?php echo $this->ts_functions->getlanguage('openshop','homepage','solo'); ?> </a>
						<?php	 }else {?>
							<a class="tp_btn" href="<?php echo base_url().'vendorboard'; ?>"><?php echo $this->ts_functions->getlanguage('openshop','homepage','solo'); ?> </a>
						<?php } 
						}else{?>
                         <a class="tp_btn" href="<?php echo base_url().'authenticate/login'; ?>"><?php echo $this->ts_functions->getlanguage('openshop','homepage','solo'); ?> </a>
                       <?php } ?>						
					
				</div>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
				<div class="tp_selling_buying_div">
					<span><i class="flaticon-commerce"></i></span>
					<h3><?php echo $this->ts_functions->getlanguage('startbuying','homepage','solo'); ?></h3>
					<p><?php echo $this->ts_functions->getlanguage('buydigital','homepage','solo'); ?></p>
					<a href="<?php echo base_url().'home/products'; ?>" class="tp_btn"><?php echo $this->ts_functions->getlanguage('startshoping','homepage','solo'); ?></a>
				</div>
			</div>
		</div>
	</div>
</div>
<?php } ?>

<?php if(!empty($productdetails)) { ?>
<div class="tp_gray_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_heading_div tp_bottompadder50">
					<h2><?php echo $this->ts_functions->getlanguage('ourlatestthemetext','homepage','solo');?></h2>
					<p><?php echo $this->ts_functions->getlanguage('latestsubheading','homepage','solo');?></p>
				</div>
			</div>
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_filter">
					<ul>
                    <?php
                        echo '<li><a class="cateCls active" id="0">'.$this->ts_functions->getlanguage('alltext','homepage','solo').'</a></li>';
                        foreach($categoryList as $soloCate) {
                            if( $this->ts_functions->getsettings('dontshow','emptycate') == '1' ) {
                                $checkProd = $this->DatabaseModel->access_database('ts_products','select','',array('prod_cateid'=>$soloCate['cate_id']));

                                echo  !empty($checkProd) ? '<li><a class="cateCls" id="'.$soloCate['cate_id'].'" >'.$soloCate['cate_name'].'</a></li>' : '';
                            }
                            else{
                                echo '<li><a class="cateCls" id="'.$soloCate['cate_id'].'" >'.$soloCate['cate_name'].'</a></li>';
                            }
                        }
                    ?>
					</ul>
				</div>
			</div>
			<div id="portfolio" class="tp_filterdata">
		 <?php
			foreach($productdetails as $soloFet){
			   $prodName = $this->ts_functions->getProductName($soloFet['prod_id']);
			   $prodImage = $this->ts_functions->getProductPic($soloFet['prod_image']);
			   $prodUrl   = base_url().'item/'. $prodName.$soloFet['prod_uniqid'];
        	   
               $catename = strtolower($soloFet['cate_urlname']);
               $catename = str_replace(' ','-',$catename);
               $catename = preg_replace('!-+!', '-', $catename);
			   $cat_url  =base_url().'home/products/'. $catename;
               $prod_demourl='';
               if($soloFet['prod_demourl']){
				$prod_demourl= base_url().'item/'.$prodName.'live_demo/'.$soloFet['prod_uniqid']; 
			   }
               
			   if( $soloFet['prod_free'] == '0') {
				  $prod_price=$this->ts_functions->getsettings('portalcurreny','symbol').' '.$soloFet['prod_price']; 
			   }else{
				  $prod_price=$this->ts_functions->getlanguage('freetext','commontext','solo'); 
			   }
			   if( $this->ts_functions->getsettings('portal','revenuemodel') != 'subscription' ) {
				   $purDetail = $this->DatabaseModel->access_database('ts_purchaserecord','select','',array('purrec_prodid'=>$soloFet['prod_id']));
				   $prod_sale=count($purDetail);
			   }else{
				  $prod_sale=$soloFet['prod_download_count']; 
			   }
			   
			   $vendorName = $this->ts_functions->getVendorName($soloFet['prod_uid']);
			   $vendo_url=base_url().'vendor/'.$vendorName;
			   
			   ?> 
				<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
						<div class="tp_product_div">
					<div class="tp_product_img" >
						<img src="<?php echo $prodImage; ?>" class="img-responsive" alt="">
						<?php
                         if($prod_demourl!=''){?>
						  <div class="tp_overlay"></div>
							<div class="tp_overlay_btn">
								<a href="<?php echo $prod_demourl; ?>" class="tp_btn" target="_blank"><?php echo $this->ts_functions->getlanguage('livedemotab','homepage','solo');?></a>
							</div>	 
							 
						 <?php }?>
					</div>
					<div class="tp_product_data">
						<h3><a href="<?php echo $prodUrl; ?>"><?php echo $soloFet['prod_name'];  ?></a></h3>
						<p><?php echo substr(strip_tags($soloFet['prod_description']),0,150).' ...';?></p>
						<ul>
							<li><a href="<?php echo $vendo_url;  ?>"><i class="fa fa-user"></i> <?php echo ucfirst($vendorName); ?></a></li>
							<li><a href="<?php echo $cat_url; ?>"><i class="fa fa-tag"></i><?php echo $catename; ?></a></li>
						</ul>
						<div class="tp_divider"></div>
						
						<div class="tp_sales_data">
							<h4><i class="fa fa-shopping-cart"></i> <?php echo $prod_sale.' ' . $this->ts_functions->getlanguage('salestext','commontext','solo'); ?> </h4>
						</div>
						<div class="tp_price_div">
							<h4><?php echo $prod_price; ?></h4>
						</div>
						<div class="tp_btndiv">
							<a href="<?php echo $prodUrl; ?>" class="tp_btn"><?php echo $this->ts_functions->getlanguage('viewbtn','homepage','solo') ?></a>
						</div>
					</div>
				</div>
				</div>
			<?php } ?>	
				
			</div>
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_btndiv">
					
					<a href="<?php echo $basepath;?>home/products" class="tp_btn"><?php echo $this->ts_functions->getlanguage('viewmoretext','commontext','solo');?></a>
				</div>
			</div>
		</div>
	</div>
</div>
<?php } ?>

<?php if(!empty($testi_details)) { ?>
<!-- Client say wrapper Start -->
<div class="tp_white_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_heading_div tp_bottompadder50">
					<h2><?php echo $this->ts_functions->getlanguage('ourclientsaystext','homepage','solo');?></h2>
					<p><?php echo $this->ts_functions->getlanguage('ourclientssubtext','homepage','solo');?></p>
				</div>
			</div>
			<div class="tp_clientslider">
				<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 col-lg-offset-4 col-md-offset-4">
					<div id="thumbnails" class="owl-carousel">
                      <?php 
                      $testi_active='active';
					  foreach($testi_details as $solotesti) {
					    $testi_image=base_url().'webimage/dummy_testi.jpg';
						if( $solotesti['testi_image'] != '' ) {	
						$testi_image=base_url().'webimage/' .$solotesti['testi_image'];
						}  
					   ?>				
						<div class="item <?php echo $testi_active; ?>">
							<div class="tp_client_img">
								<img src="<?php echo $testi_image; ?>" class="img-responsive" alt="thumb"/>
							</div>
						</div>
					  <?php $testi_active=''; } ?>	
						
					</div>
				</div>
				<div class="col-lg-10 col-md-10 col-sm-12 col-xs-12 col-lg-offset-1 col-md-offset-1">
					<div id="slider" class="owl-carousel owl-theme">
						<?php  foreach($testi_details as $solotesti) {?>
						<div class="item">
							<div class="tp_client_content">
								<div class="tp_client_content_inner">
									<div class="tp_quote_left">
										<img src="<?php echo base_url().'themes/themeone/' ?>images/quote_left.png" class="img-responsive" alt="">
									</div>
									<div class="tp_client_name"><h5>-<?php echo $solotesti['testi_name'];?></h5>
									<?php if($solotesti['testi_showdesig'] == '1') { ?>
									<span><?php echo $solotesti['testi_desig'];?></span>
									<?php } ?>
									</div>
									<p><?php echo $testi_details[0]['testi_msg'];?></p>
									<div class="tp_quote_right">
										<img src="<?php echo base_url().'themes/themeone/' ?>images/quote_right.png" class="img-responsive" alt="">
									</div>
								</div>
							</div>
						</div>
						<?php } ?>	
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- Client say wrapper End -->
<?php } ?>

<?php if( $this->ts_functions->getsettings('shownewsletter','checkbox') == '1' ) { ?>
<!-- Newsletter wrapper Start -->
<div class="tp_gray_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 col-lg-offset-2 col-md-offset-2">
				<div class="tp_newsletter_div">
					<span><i class="flaticon-email-filled-closed-envelope"></i></span>
					<h2><?php echo $this->ts_functions->getlanguage('newsletterheading','homepage','solo');?></h2>
			        <p><?php echo $this->ts_functions->getlanguage('newslettersubheading','homepage','solo');?></p>
					<div class="tp_sebscribe_form">
						<form class="form-inline">
							<div class="form-group">
								<input type="text" class="form-control" placeholder="<?php echo $this->ts_functions->getlanguage('newsletterplaceholder','homepage','solo');?>" id="email_from_newsletter">
							</div>
							<button class="tp_btn" type="button" onclick="subscribe_email('newsletter')"><?php echo $this->ts_functions->getlanguage('newsletterbutton','homepage','solo');?></button>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>	
</div>
<!-- Newsletter wrapper End -->
<?php } ?>

<!-- Language Content STARTS -->
<input type="hidden" value="<?php echo $this->ts_functions->getlanguage('newslettersuc','message','solo');?>" id="newslettersucsuc_text">
<input type="hidden" value="<?php echo $this->ts_functions->getlanguage('email','message','solo');?>" id="emailerr_text">
<input type="hidden" value="<?php echo $this->ts_functions->getlanguage('newslettererr','message','solo');?>" id="newslettersucerr_text">
<!-- Language Content ENDS -->